/**
 * Created by lixin on 2019-11-22
 */
import Taro, {Component} from '@tarojs/taro'
import {Image, Text, View} from '@tarojs/components'
/**
 * 由于 app.js 添加的样式文件 在小程序上只能影响 page 样式,不能影响 component 的样式，所以在使用自定义组件时，你可能需要再次引入
 */
import 'taro-ui/dist/style/components/flex.scss'
import './shoppingCard.less'
import {AtTag, AtToast} from "taro-ui";


export default class ShoppingCard extends Component {

  constructor(props) {
    super(props);

    this.state = {
      isOpened: false,
    }
  }

  render() {

    const {hot} = this.props;
    const {isOpened} = this.state;

    const _url = 'http://storage.360buyimg.com/mtd/home/32443566_635798770100444_2113947400891531264_n1533825816008.jpg'
    return (
      <View>
        <Image
          className='tab-img'
          src={_url}
          alt=''
          mode='aspectFill'
          lazyLoad={true}
        />
        <Text className='tab-shopping-name'>
          <Text className='tab-shopping-wl'>京东物流</Text>
          【第二件1元】牛奶洗面奶氨基酸洗面...
        </Text>
        <View className='at-row at-row__justify--between'>
          <View className='at-col'>
            <Text className='tab-shopping-money'>￥39</Text>
          </View>
          <View className='at-col tab-shopping-tag'>
            <AtTag size='small'>看相似</AtTag>
          </View>
        </View>
        {
          hot ? (
            <View className='tab-hot-shopping'>
              <AtTag size='small' active circle>大家都在买的热销商品</AtTag>
            </View>
          ) : ''
        }

      </View>
    )
  }
}
